<!DOCTYPE html>
<html lang="en">
  <head>
    <script type="module" src="/@vite/client"></script>

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Minions Web App</title>
    <style>
      :root {
        --primary-color: #4a6bfd;
        --secondary-color: #f5f7ff;
        --text-color: #333;
        --border-radius: 12px;
        --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      }

      body {
        font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
        margin: 0;
        padding: 0;
        background-color: #f9f9fb;
        color: var(--text-color);
        line-height: 1.6;
      }

      .container {
        max-width: 920px;
        margin: 0 auto;
        padding: 2.5rem 2rem;
      }

      header {
        margin-bottom: 2.5rem;
      }

      h1 {
        color: var(--primary-color);
        margin: 0;
        font-size: 2.2rem;
        font-weight: 600;
      }

      .card {
        background: white;
        border-radius: var(--border-radius);
        padding: 1.8rem;
        margin-bottom: 2rem;
        box-shadow: var(--box-shadow);
        border: 1px solid rgba(0, 0, 0, 0.03);
      }

      label {
        display: block;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: var(--primary-color);
        font-size: 1.25rem;
      }

      textarea {
        width: 100%;
        height: 120px;
        padding: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: var(--border-radius);
        font-family: inherit;
        resize: vertical;
        margin-bottom: 0.5rem;
        box-sizing: border-box;
        font-size: 1rem;
        line-height: 1.5;
        transition: border-color 0.2s;
      }

      textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(74, 107, 253, 0.2);
      }

      input[type="text"],
      input[type="password"] {
        width: 100%;
        padding: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: var(--border-radius);
        font-family: inherit;
        margin-bottom: 0.5rem;
        box-sizing: border-box;
        font-size: 1rem;
        line-height: 1.5;
        transition: border-color 0.2s;
      }

      input[type="text"]:focus,
      input[type="password"]:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(74, 107, 253, 0.2);
      }

      select {
        width: 100%;
        padding: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: var(--border-radius);
        font-family: inherit;
        margin-bottom: 0.5rem;
        box-sizing: border-box;
        font-size: 1rem;
        line-height: 1.5;
        transition: border-color 0.2s;
        background-color: white;
        cursor: pointer;
      }

      select:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(74, 107, 253, 0.2);
      }

      button {
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 0.9rem 2rem;
        border-radius: var(--border-radius);
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 1.1rem;
        margin-bottom: 2rem;
      }

      button:hover {
        background-color: #3655d8;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(74, 107, 253, 0.25);
      }

      button:active {
        transform: translateY(0);
      }

      .log-container {
        background: white;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        padding: 1.8rem;
        border: 1px solid rgba(0, 0, 0, 0.03);
      }

      h2 {
        color: #333;
        margin-top: 0;
        margin-bottom: 1.2rem;
        font-weight: 600;
        font-size: 1.5rem;
      }

      pre {
        background: var(--secondary-color);
        padding: 1.5rem;
        border-radius: 8px;
        overflow: auto;
        white-space: pre-wrap;
        font-family: monospace;
        box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.05);
        min-height: 100px;
        font-size: 0.95rem;
        line-height: 1.5;
      }

      @media (max-width: 768px) {
        .container {
          padding: 1.5rem 1rem;
        }

        h1 {
          font-size: 1.8rem;
        }

        .card,
        .log-container {
          padding: 1.2rem;
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <header>
        <!-- <img
          src="../assets/minions_logo_dark.png"
          alt="Minions Logo"
          class="logo"
        /> -->
        <h1>Minions WebGPU App</h1>
      </header>

      <div class="card">
        <label for="api_key">OpenAI API Key:</label>
        <input
          type="password"
          id="api_key"
          placeholder="Enter your OpenAI API key here"
        />
        <small style="display: block; margin-top: 0.5rem; color: #777"
          >Your API key is used for cloud supervision and never stored or
          shared.</small
        >
      </div>

      <div class="card">
        <label for="model_select">Local Model:</label>
        <select id="model_select">
          <option value="Llama-3.2-1B-Instruct-q4f16_1-MLC">Llama-3.2-1B-Instruct (q4f16_1) - Recommended</option>
          <option value="Llama-3.2-3B-Instruct-q4f16_1-MLC">Llama-3.2-3B-Instruct (q4f16_1)</option>
          <option value="Llama-3.1-8B-Instruct-q4f16_1-MLC">Llama-3.1-8B-Instruct (q4f16_1)</option>
          <option value="Llama-3-8B-Instruct-q4f16_1-MLC">Llama-3-8B-Instruct (q4f16_1)</option>
          <option value="Qwen2.5-0.5B-Instruct-q4f16_1-MLC">Qwen2.5-0.5B-Instruct (q4f16_1)</option>
          <option value="Qwen2.5-1.5B-Instruct-q4f16_1-MLC">Qwen2.5-1.5B-Instruct (q4f16_1)</option>
          <option value="Qwen2.5-3B-Instruct-q4f16_1-MLC">Qwen2.5-3B-Instruct (q4f16_1)</option>
          <option value="Qwen2.5-7B-Instruct-q4f16_1-MLC">Qwen2.5-7B-Instruct (q4f16_1)</option>
          <option value="gemma-2-2b-it-q4f16_1-MLC">Gemma-2-2B-IT (q4f16_1)</option>
          <option value="gemma-2-9b-it-q4f16_1-MLC">Gemma-2-9B-IT (q4f16_1)</option>
          <option value="Phi-3.5-mini-instruct-q4f16_1-MLC">Phi-3.5-Mini-Instruct (q4f16_1)</option>
          <option value="SmolLM2-1.7B-Instruct-q4f16_1-MLC">SmolLM2-1.7B-Instruct (q4f16_1)</option>
        </select>
        <small style="display: block; margin-top: 0.5rem; color: #777"
          >Select a local model to run in your browser. Smaller models (1B-3B) load faster and use less memory.</small
        >
      </div>

      <div class="card">
        <label for="task">Task:</label>
        <textarea id="task">
Summarize the second paragraph of the context.</textarea
        >
      </div>

      <div class="card">
        <label for="context">Context:</label>
        <textarea id="context">
Here goes your multi-paragraph context text…</textarea
        >
      </div>

      <button id="start">Start Conversation</button>

      <div class="log-container">
        <h2>Conversation Log</h2>
        <pre id="log"></pre>
      </div>
    </div>

    <script type="module" src="main.js"></script>
  </body>
</html>
